<?php
namespace app\index\controller;

use app\index\controller\common as common;

use app\index\model\Pipeline as Pipeline;
use app\index\model\Scene as Scene;
use app\index\model\Shot as Shot;

use app\index\validate\SceneinfoCheck;
use app\index\validate\SceneAddCheck;

use app\index\validate\ShotinfoCheck;
use app\index\validate\ShotAddCheck;


class Shotapi extends common
{
   protected $fieldStatus = 'status';
   public function get_pip_id(){
	   	/*验证参数*/
	    $validate = new SceneinfoCheck();
	    list($msg,$result)= $validate->goapiCheck();
	    if($msg){
    	       list($msg,$result)= Pipeline::get_pip_id();
        }
	   return returnresult($msg,$result) ;    	 
	}

    public function add_scene()
    {
        /*验证参数*/
        $validate = new SceneAddCheck();
        list($msg,$result)= $validate->goapiCheck();     
        if($msg){
            list($msg,$result) = Scene::add_data();
        }
        return returnresult($msg,$result) ;   
    }

    public function get_scene_id(){
        /*验证参数*/
        $validate = new ShotinfoCheck();
        list($msg,$result)= $validate->goapiCheck();
        if($msg){
            list($msg,$result) = Scene::get_scene_id() ;
            }
        return returnresult($msg,$result) ;   
    }

    public function add_Shot()
    {
        /*验证参数*/
        $validate = new ShotAddCheck();
        list($msg,$result)= $validate->goapiCheck();      
        if($msg){
            list($msg,$result) = Shot::add_data();
        }
        return returnresult($msg,$result) ;   
    }

         public function forbid($id)
    {   
        $data= ['id'=>$id, $this->fieldStatus=>0] ;
        Shot::update_data($data) ;
        return ajax_return_adv("修改成功", '') ;
    }

     public function resume($id)
    {
        $data= ['id'=>$id, $this->fieldStatus=>1] ;
        Shot::update_data($data) ;
        return ajax_return_adv("修改成功", '') ;
    }
}

